// TODO: i18n message
import { Rule } from 'rc-field-form/lib/interface';

const genValidConfig = (params: any) => {
  const config: Rule = {
    required: true,
    message: params.message ? `Not a validate ${params.message as string}` : `${params.name as string} is required`,
    type: params.type,
  };

  return [config];
};

export { genValidConfig };
